//
//  HTTPGlobals.h
//  reSearchDemo
//
//  Created by 科技 on 15/8/6.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#import "MBProgressHUD.h"
#import "KAlertView.h"
@interface HTTPGlobals : NSObject


@property(nonatomic,strong)AFHTTPRequestOperationManager *manager;
/**
 *  菊花器
 */
@property(nonatomic,strong)MBProgressHUD *HUD;

+ (HTTPGlobals *)shareHTTPGlobal;

- (HTTPGlobals *)initHTTPGlobals;

/**
 *  http://yunku.mobi/index.php接口请求方法
 *
 *  @param URL    url
 *  @param params 参数
 *  @param finish 返回结果
 */
-(void)GetUserHTTPRequest:(NSString *)URL parameters:(NSDictionary *)params finish:(void(^)(BOOL seccess,NSString *error,id obj))finish;

/** get方法 */
-(void)GetHTTPRequest:(NSString *)URL parameters:(NSDictionary *)params finish:(void(^)(BOOL seccess,NSString *error,id obj))finish;

/** post方法 */
-(void)PostHTTPRequest:(NSString *)URL parameters:(NSDictionary *)params finish:(void(^)(BOOL seccess,NSString *error,id obj))finish;

/** 上传图片 */
-(void)uploadImageWithUrl:(NSString *)url
                    image:(UIImage *)image
                imageName:(NSString *)imageName
               parameters:(NSDictionary *)params
                   finish:(void(^)(BOOL seccess,NSError *error,id obj))finish;

/** 上传多张图片 */
-(void)uploadImageWithUrl:(NSString *)url
                 imageArr:(NSArray *)imageArr
             imageNameArr:(NSArray *)imageNameArr
               parameters:(NSDictionary *)params
                   finish:(void(^)(BOOL seccess,NSError *error,id obj))finish;
//-(void)uploadImageWithUrl:(NSString *)url
//                    image:(UIImage *)image
//constructingBodyWithBlock:(void(^)(id<AFMultipartFormData> formData)) formdata
//                   finish:(void(^)(BOOL seccess,NSError *error,id obj))finish;
@end
